import request from '@/utils/request'

//获取指定分类的列表
export function GetPageOfArticleByParentId(parentId, title,page, pageSize) {
  return request({
    url: 'article/GetPageOfArticleByParentId',
    method: 'get',
    params: {
      parentId: parentId,
      title:title,
      page: page,
      pageSize: pageSize
    }
  })
}
//根据parentId获取
export function GetCategoryAndSelfByRoute(parentId) {
  return request({
    url: 'article/GetCategoryAndSelfByRoute',
    method: 'get',
    params: {
      parentId: parentId
    }
  })
}

//添加文章
export function addArticle(article) {
  return request({
    url: 'article/addArticle',
    method: 'post',
    data: article
  })
}

//
export function GetArticleById(id) {
  return request({
    url: 'article/GetArticleById',
    method: 'get',
    params: {
      articleId: id
    }
  })
}


export function updateArticle(article) {
  return request({
    url: 'article/updateArticle',
    method: 'post',
    data: article
  })
}

export function deleteArticle(id) {
  return request({
    url: 'article/deleteArticle',
    method: 'get',
    params: {
      id: id
    }
  })
}
